package com.net.oil.user.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.user.contract.DeleteAccountContract;
import com.net.oil.user.model.DeleteAccountModel;

/**
 * 作者：lch
 * 时间：2019/4/21 0021:下午 18:42
 * 邮箱：245850413@qq.com
 * 说明：
 */
public class DeleteAccountPresenter extends BasePresenter<DeleteAccountContract.View> implements DeleteAccountContract.Presenter {

    private DeleteAccountContract.View view;
    private DeleteAccountContract.Model model;

    public DeleteAccountPresenter(DeleteAccountContract.View view) {
        this.view = view;
        model = new DeleteAccountModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getPhoneCode(String phone, boolean ptt) {
        model.getPhoneCode(phone, ptt);
    }

    @Override
    public void getPhoneCodeSuccess() {
        view.getPhoneCodeSuccess();
    }

    @Override
    public void getPhoneCodeFailed() {
        view.getPhoneCodeFailed();
    }

    @Override
    public void deleteAccount(String phone, String password, String code) {
        model.deleteAccount(phone, password, code);
    }

    @Override
    public void deleteAccountSuccess() {
        view.deleteAccountSuccess();
    }

    @Override
    public void deleteAccountFailed() {
        view.deleteAccountFailed();
    }
}
